#include <cstdio>
#include<string>
#include <iostream>
#define MAX_U 100005
using namespace std;
int father[MAX_U];
int rank_f[MAX_U];

void init(int N) {

	for (int i = 0; i < N; i++)
	{
		father[i] = i;
		rank_f[i] = 1;
	}
}


int findFather(int x) {

	while (father[x] != x)
	{
		x = father[x];
	}

	return x;
}

int unitGroup(int x, int y) {

	if (x == -1)
	{
		return y;
	}

	int root;
	x = findFather(x);
	y = findFather(y);

	if (x == y)
	{
		return x;
	}

	if (rank_f[x] < rank_f[y])
	{
		father[x] = y;
		root = y;
	}
	else
	{
		father[y] = x;
		root = x;
		if (rank_f[x] == rank_f[y])
		{
			rank_f[x]++;
		}
	}

	return root;
}

bool ifGroup(int x, int y) {

	return findFather(x) == findFather(y);

}

typedef struct node {
	int u;
	int v;
}Node;
Node nodes[MAX_U];
int ope[MAX_U][3], des[MAX_U] = { 0 }, out[MAX_U] = {0};
int main() {
	
	int n, m, q;
	scanf("%d%d%d",&n,&m,&q);
	init(n);

	for (int i = 0; i < m; i++)
	{
		scanf("%d%d",&nodes[i].u,&nodes[i].v);
	}

	char ch;
	for (int i = 0; i < q; i++)
	{
		scanf(" %c",&ch);
		if (ch == 'Z')
		{
			ope[i][0] = 2;
			scanf("%d%d",&ope[i][1],&ope[i][2]);
		}
		else if (ch == 'P')
		{
			ope[i][0] = 1;
			scanf("%d", &ope[i][1]);
			des[i] = 1;
		}
	}

	for (int i = 0; i < m; i++)
	{
		if (des[i] == 0) {
			unitGroup(nodes[i].u, nodes[i].v);
		}
	}

	int j = 0;
	for (int i = q-1 ; i >= 0; i--)
	{
		if (ope[i][0] == 2)
		{
			if (ifGroup(ope[i][1],ope[i][2]))
			{
				out[j++] = 1;
			}
			else
			{
				out[j++] = 2;
			}
		}
		else if(ope[i][0] == 1)
		{
			unitGroup(nodes[ope[i][1]].u, nodes[ope[i][1]].v);
		}
	}

	for (int i = j-1; i >= 0 ; i--)
	{
		if (out[i] == 1)
		{
			printf("Yes\n");
		}
		else
		{
			printf("No\n");
		}
	}
	return 0;
}